<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class AlterTableAddUseTimeAndUseShopIdToCustomerCoupons extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('customer_coupons', function (Blueprint $table) {
            $table->unsignedBigInteger('useShopId')->default(0)->comment('使用门店id')->after('couponId');
            $table->unsignedInteger('useTime')->default(0)->comment('使用时间')->after('couponId');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('customer_coupons', function (Blueprint $table) {
            $table->dropColumn('useShopId');
            $table->dropColumn('useTime');
        });
    }
}
